package unit5.collection;

import unit4.Class.jicheng.Student;

import java.util.HashMap;

/**
 * HashMap测试类
 */

public class HashMapTest {
    public static void main(String[] args) {
        //初始化Map
        HashMap map=new HashMap();
        Student s1=new Student("张三","1111","四川幼专");
        Student s2=new Student("李四","2222","四川幼专");
        Student s3=new Student("王五","3333","四川幼专");
        Student s4=new Student("赵六","4444","四川幼专");
        Student s5=new Student("黄七","5555","四川幼专");
        map.put("A",s1);
        map.put("B",s2);
        map.put("C",s3);
        map.put("D",s4);
        map.put("E",s5);
        map.put(1,s5);
       // map.put("F",s4);//覆盖
        //从map里取出
        System.out.println(map.keySet());
        System.out.println(map.values());
        System.out.println(map.entrySet());
        Student o=(Student)map.get(1);
        o.study();
    }
}
